package com.niiwoo.civet.account.dao.mapper;

import com.niiwoo.civet.account.dao.entity.BankCardRebindOrder;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface BankCardRebindOrderMapperExt extends BankCardRebindOrderMapper{

    /**
     * 查询已提交待审核的换绑卡申请
     * @param userId
     * @return
     */
    BankCardRebindOrder selectCurrentRebindOrder(String userId);

    /**
     * 查询已提交待审核的换绑卡申请
     * @param userId 用户ID
     * @param accountIds 账户ID列表:集团账户有两条记录
     * @return
     */
    BankCardRebindOrder selectCurrentRebindOrderWithAccountIds(@Param("userId") String userId, @Param("accountIds") List<Long> accountIds);

    /**
     * 根据请求流水号查询换绑卡订单
     * @param requestNo
     * @return
     */
    BankCardRebindOrder selectByRequestNo(String requestNo);

    /**
     * 根据主键进行排他锁查询
     * @param id
     * @return
     */
    BankCardRebindOrder selectByPrimaryKeyForUpdate(Long id);

    /**
     * 换绑卡计划任务
     * @return
     */
    List<BankCardRebindOrder> listBankCardForJob();

}